package com.fengniu.ejb.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

@Entity
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region = "ContentCache", include = "all")
@Table(name = "ContentTable", schema = "FENGNIU", uniqueConstraints = {})
@NamedQueries( { @NamedQuery(name = "Content.eql.findContentLeafCategoryBy", query = "SELECT c2g FROM  Content2Category  c2g where  c2g.content.sysId=:contentSysId AND c2g.relationId=:relationId AND c2g.category.typeId=:categoryTypeID AND c2g.category NOT IN (select g.primaryParent FROM Category g where g.primaryParent=c2g.category)") })
public class Content extends GeneEntity implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 8031513597354666951L;

	@Column(nullable = false, unique = true, updatable = false)
	private String contentId;

	@Column(nullable = false)
	private String name;

	private String fullName;

	private String mainFeature;

	private String smallImage;

	private String mediumImage;

	private String largeImage;

	private Double listPrice = new Double(0);

	@Basic(fetch = FetchType.LAZY)
	private String approveDesc;

	private Integer integral = new Integer(0); // 积分

	@Temporal(value = TemporalType.TIMESTAMP)
	private Date startDate;

	@Temporal(value = TemporalType.TIMESTAMP)
	private Date endDate;

	@Temporal(value = TemporalType.DATE)
	private Date lastRankedDate;

	public String getContentId() {
		return contentId;
	}

	public void setContentId(String contentId) {
		this.contentId = contentId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Double getListPrice() {
		return listPrice;
	}

	public void setListPrice(Double listPrice) {
		this.listPrice = listPrice;
	}

	public String getApproveDesc() {
		return approveDesc;
	}

	public void setApproveDesc(String approveDesc) {
		this.approveDesc = approveDesc;
	}

	public String getFullName() {
		return fullName;
	}

	public void setFullName(String fullName) {
		this.fullName = fullName;
	}

	public String getMainFeature() {
		return mainFeature;
	}

	public void setMainFeature(String mainFeature) {
		this.mainFeature = mainFeature;
	}

	public Integer getIntegral() {
		return integral;
	}

	public void setIntegral(Integer integral) {
		this.integral = integral;
	}

	public Date getLastRankedDate() {
		return lastRankedDate;
	}

	public void setLastRankedDate(Date lastRankedDate) {
		this.lastRankedDate = lastRankedDate;
	}

	public String getSmallImage() {
		return smallImage;
	}

	public void setSmallImage(String smallImage) {
		this.smallImage = smallImage;
	}

	public String getMediumImage() {
		return mediumImage;
	}

	public void setMediumImage(String mediumImage) {
		this.mediumImage = mediumImage;
	}

	public String getLargeImage() {
		return largeImage;
	}

	public void setLargeImage(String largeImage) {
		this.largeImage = largeImage;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

}
